extend layout

block append content
  #everything
    #head
      h1 Tor-Tank.com
      nav#nav
        ol
          li
            a(href="/") Optimizer
          li |
          li
            a(href="/about") About the Optimizer
  
    #body
      #main
        #announce
          | I no longer play SW:TOR, so these calculations may be out of date. I have no intention of
          |  shutting the site down, but I do not have the time to research changes and add new items.
          |  If there are changes that should be made, please feel free to detail them in a&#32;
          a(href="https://github.com/swtor-apps/swtor-tanking/issues") GitHub issue
          |  or, even better, submit a pull request to the GitHub project with the changes added.
        #entry
          h2 Current Stats
          form(method="POST", action="/api/optimize", onsubmit="return false;")
            fieldset
              label(for='class') Class
              select#class(name="class", size=1)
                option(value='shadow') Shadow/Assassin
                option(value='vanguard') Vanguard/Powertech
                option(value='guardian') Guardian/Juggernaut
              
              label(for='defRating') Defense Rating (without stim)
              input#defRating(name='defRating', type="number", min=0, max=10000, increment=1, value=0)
              
              label(for='shieldRating') Shield Rating
              input#shieldRating(name='shieldRating', type="number", min=0, max=10000, increment=1, value=0)
              
              label(for='absorbRating') Absorb Rating
              input#absorbRating(name='absorbRating', type="number", min=0, max=10000, increment=1, value=0)
              
              label(for='armorRating') Armor Rating
              input#armorRating(name='armorRating', type="number", min=0, max=20000, increment=1, value=0)
              
              label(for='relic1') Relic 1
              select#relic1(name='relic1', size=1)
                option(value='none') None / Other
                optgroup(label="Arkanian")
                  option(value='arkanian:redoubt') Arkanian Relic of Fortunate Redoubt
                  option(value='arkanian:shield_amp') Arkanian Relic of Shield Amplification
                  option(value='arkanian:imperiling') Arkanian Relic of Imperiling Severity
                  option(value='arkanian:shrouded') Arkanian Relic of the Shrouded Crusader
                optgroup(label="Underworld")
                  option(value='underworld:redoubt') Underworld Relic of Fortunate Redoubt
                  option(value='underworld:shield_amp') Underworld Relic of Shield Amplification
                  option(value='underworld:imperiling') Underworld Relic of Imperiling Severity
                  option(value='underworld:shrouded') Underworld Relic of the Shrouded Crusader
                optgroup(label="Partisan")
                  option(value='partisan:redoubt') Partisan Relic of Fortunate Redoubt
                  option(value='partisan:shield_amp') Partisan Relic of Shield Amplification
                optgroup(label="Conqueror")
                  option(value='conqueror:redoubt') Conqueror Relic of Fortunate Redoubt
                  option(value='conqueror:shield_amp') Conqueror Relic of Shield Amplification
                optgroup(label="Dread Guard")
                  option(value='dreadguard:shield_amp') Dread Guard Relic of Shield Amplification
                  option(value='dreadguard:imperiling') Dread Guard Relic of Imperiling Severity
                  option(value='dreadguard:shrouded') Dread Guard Relic of the Shrouded Crusader
                optgroup(label="Campaign")
                  option(value='campaign:shield_amp') Campaign Relic of Shield Amplification
                  option(value='campaign:imperiling') Campaign Relic of Imperiling Severity
                  option(value='campaign:shrouded') Campaign Relic of the Shrouded Crusader
                optgroup(label="Elite War Hero")
                  option(value='elitewarhero:shield_amp') Elite War Hero Relic of Shield Amplification
                optgroup(label="War Hero")
                  option(value='warhero:shield_amp') War Hero Relic of Shield Amplification
              
              label(for='relic2') Relic 2
              select#relic2(name='relic2', size=1)
                option(value='none') None / Other
                optgroup(label="Arkanian")
                  option(value='arkanian:redoubt') Arkanian Relic of Fortunate Redoubt
                  option(value='arkanian:shield_amp') Arkanian Relic of Shield Amplification
                  option(value='arkanian:imperiling') Arkanian Relic of Imperiling Severity
                  option(value='arkanian:shrouded') Arkanian Relic of the Shrouded Crusader
                optgroup(label="Underworld")
                  option(value='underworld:redoubt') Underworld Relic of Fortunate Redoubt
                  option(value='underworld:shield_amp') Underworld Relic of Shield Amplification
                  option(value='underworld:imperiling') Underworld Relic of Imperiling Severity
                  option(value='underworld:shrouded') Underworld Relic of the Shrouded Crusader
                optgroup(label="Partisan")
                  option(value='partisan:redoubt') Partisan Relic of Fortunate Redoubt
                  option(value='partisan:shield_amp') Partisan Relic of Shield Amplification
                optgroup(label="Conqueror")
                  option(value='conqueror:redoubt') Conqueror Relic of Fortunate Redoubt
                  option(value='conqueror:shield_amp') Conqueror Relic of Shield Amplification
                optgroup(label="Dread Guard")
                  option(value='dreadguard:shield_amp') Dread Guard Relic of Shield Amplification
                  option(value='dreadguard:imperiling') Dread Guard Relic of Imperiling Severity
                  option(value='dreadguard:shrouded') Dread Guard Relic of the Shrouded Crusader
                optgroup(label="Campaign")
                  option(value='campaign:shield_amp') Campaign Relic of Shield Amplification
                  option(value='campaign:imperiling') Campaign Relic of Imperiling Severity
                  option(value='campaign:shrouded') Campaign Relic of the Shrouded Crusader
                optgroup(label="Elite War Hero")
                  option(value='elitewarhero:shield_amp') Elite War Hero Relic of Shield Amplification
                optgroup(label="War Hero")
                  option(value='warhero:shield_amp') War Hero Relic of Shield Amplification
              
              label(for='stim') Stim
              select#stim(name="stim", size=1)
                option(value='proto_nano') Prototype Nano-infused Fortitude Stim
                option(value='reuse_nano') Reusable Nano-infused Fortitude Stim
                option(value='none') No Stim
                
              .pseudo-label
              button#process.pos(type="submit") Optimize...
              button#clear.neg(type="button") Clear
              
            a.small#extraParams(href="/", onclick="return false;") Advanced Options...
            #advancedOptions
              fieldset(style="display: none;")
                input#useAdvanced(type='checkbox', name='useAdvanced', value='yes') 
                label.no-block(for='useAdvanced', style="margin-left: 5px;") Override advanced options 
              
                label(for='dmgMRKE') Melee/Ranged Kinetic Energy Damage Percent
                input#dmgMRKE(type='number', name='dmgMRKE', min=0, max=1, increment=0.001, value=0) 
                
                label(for='dmgFTKE') Force/Tech Kinetic/Energy Damage Percent
                input#dmgFTKE(type='number', name='dmgFTKE', min=0, max=1, increment=0.001, value=0)
                
                label(for='dmgFTIE') Force/Tech Internal/Elemental Damage Percent
                input#dmgFTIE(type='number', name='dmgFTIE', min=0, max=1, increment=0.001, value=0)
                
                label(for='swingTime') Swing Timer
                input#swingTime(type='number', name='swingTime', min=0, max=4, increment=0.01, value=0)
              
                label(for='shieldLow') Lower Bound on Shield Budget
                input#shieldLow(type='number', name='shieldLow', min=0, max=1, increment=0.001, value=0)
                
                label(for='shieldHigh') Upper Bound on Shield Budget
                input#shieldHigh(type='number', name='shieldHigh', min=0, max=1, increment=0.001, value=1)
                
        #results
          h2 Optimized Stats
          #actual_results
            table
              tbody
                tr
                  td.label Defense Rating:
                  td#defRatingValue
                  td#defRatingDiff
                tr
                  td.label Shield Rating:
                  td#shieldRatingValue
                  td#shieldRatingDiff
                tr
                  td.label Absorb Rating:
                  td#absorbRatingValue
                  td#absorbRatingDiff
                tr
                  td.label Defense % (no stim):
                  td#defPctNS
                  td#defPctNSDiff
                tr
                  td.label Defense % (stim):
                  td#defPctS
                  td#defPctSDiff
                tr
                  td.label Shield %:
                  td#shieldPct
                  td#shieldPctDiff
                tr
                  td.label Absorb %:
                  td#absorbPct
                  td#absorbPctDiff
                tr
                  td.label Mitigation %:
                  td#mitigationPct
                  td#mitigationPctDiff
      
      #about
        h2 About the Optimizer
        p
          | The optimizations done here are for level 55 tanks only.
        p
          | The optimizations are done by a random sampling of
          | the possible space of stat distributions that a tank could
          | achieve. Due to the random factor, repeated optimizations may
          | present slightly different results. The differences, however
          | should be negligible.
        p
          | The optimization is for mitigation only. At this time, there
          | are no concerns for health pool, self-healing, or anything of
          | that sort. In the future, that should hopefully change.
        p
          | Relics are assumed to proc at their mean rate, adjusting for
          | the internal cooldowns and/or are used on every cooldown.
          | PvE proc relics are assumed not to stack with each other,
          | and at the moment, only the relic entered in slot 1 is
          | counted if two proc relics are entered. PvP proc relics are
          | assumed to stack with PvE proc relics. Click relics are 
          | also assumed to share a cooldown, and only the relic entered
          | in slot 1 is counted.
        p
          | Certain assumptions are made about the combat to calculate 
          | the mitigation score:
        ol
          li Approximately 78% of attacks are defendable (Melee and Ranged), 22% of attacks are resistable (Force and Tech).
          li Of the defendable attacks, half are at 90% accuracy, and the other half are at 100%. All resistable attacks are at 100% accuracy.
          li Of the defendable attacks, all are Kinetic and Energy. Of the resistable attacks, 20.7% of the 22% are Kinetic and Energy, and 1.3% of the 22% are Internal and Elemental. 
          li Procs and abilities (not from relics) are assumed to be used optimally (on every cooldown, except for things like Kinetic Ward), and the mitigation is an average score over an entire fight.
          li Shield ratings are bounded above and below as percentages of the stat budget, as they do not trade off against defense or absorb.
          li Attacks are incoming at a rate of 1 attack every 0.9s.
        p
          | Certain data used here has been generated by others. I would
          | like to, in particular, recognize the users of&#32;
          a(href="http://mmo-mechanics.com/") MMO Mechanics
          |  for working out the diminishing returns formulas for the tank
          | stats, and to dipstik and KeyboardNinja on the SW:TOR forums for&#32;
          | their posts (
          a(href="http://www.swtor.com/community/showthread.php?t=616779") KeyboardNinja
          |  and&#32;
          a(href="http://www.swtor.com/community/showthread.php?t=567164") dipstik 
          | ) that inspired me to work on this and for determining the
          | shield rating bounds and damage type distribution.
        p
          | This entire work is open source and available under the MIT 
          | license. The optimizer is available at&#32;
          a(href="https://github.com/swtor-apps/swtor-tanking") https://github.com/swtor-apps/swtor-tanking
          |  and the source for this website is available at&#32;
          a(href="https://github.com/swtor-apps/swtor-tanking-site") https://github.com/swtor-apps/swtor-tanking-site
          | . Contributions are always welcome, especially to improve
          | the optimizations. Please feel free to file an issue on one
          | of those projects or, even better, send a pull request.
      .dummy(style="clear:both; height: 1px;")

block js
  script(type="text/javascript")
    require("swtor-tanking-site/js")();
    
  script(type="text/javascript")
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

    ga('create', 'UA-41105646-1', 'tor-tank.com');
    ga('send', 'pageview');

